Skip to content

northcoders/nc-sample-server-wit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The NC Doughnuts API

This API concerns sales of yummy doughnuts from the Northcoders bakery.

The code should be deployable in any Unix-like OS. The build process outlined below requires Python be installed along with GNU Make. MacOS users can get access to the make command via Homebrew or MacOS Command Line Tools.

Local Deployment

To run the API locally:

Local Deployment

To run the API locally:

  1. Fork and clone the repo.
  2. Ensure that your Python interpreter is Python at least 3.11.x - you may use a tool like pyenv.
  3. In the root of the project, create the run environment with:
    make requirements
  4. Set up the required dev tools:
    make dev-setup
  5. Run the tests.
    make run-checks
  6. Start the server by running:
    make start-server
  7. In your browser, navigate to localhost:8000/docs/ to view the API documentation page.
  8. Then you can navigate to the endpoint of your choice, e.g. localhost:8000/api/doughnuts. This could be done in your browser, but a tool like Insomnia is very useful.

API logs are available in logs/app.log.

EC2 Deployment

This is an exercise for you! You should begin by getting Free Tier access to AWS. You will need to set up local credentials.

Caution: Free Tier access comes with limits - if you exceed them you can be charged!

You can try to do this manually using the console. Use the EC2 wizard to set up an instance as in the demonstration.

However, it is much better to deploy the API via Terraform. You will need to install Terraform first.

This is a tough exercise but it can teach you a lot about AWS and Infrastructure as Code.

Then, working in the terraform directory, you will need to use the terraform init command to get started.

Edit the provided .tf files to create the desired resources. We have already created the provider in main.tf. Some hints are given in the files. There are lots of challenges here! You will need to use the Terraform and AWS documentation together to figure out what needs to be done.

Some useful resources:

Good luck! and Happy Clouding!

Don't forget to take down your infrastructure when you are finished!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 72.6%
  • Makefile 19.6%
  • HCL 7.8%