NYCU-SDC / backend-training-2024

0 stars 25 forks source link

Backend Training 2024

This project is designed specifically for programs related to FastAPI. It aims to allow students to focus on learning FastAPI without worrying about environment setup. The project includes the necessary configurations and dependencies to start quickly and easily.

Prerequisites

Make sure you have the following software installed on your machine:

Project Structure

The project is structured as follows:

Setup Instructions

1. Clone the repository

git clone <repository_url>
cd <repository_directory>

2. Make your own compose and requirements

cp docker-compose.yaml.example docker-compose.yaml

3. Make sure your requirements file and project with main.py are in the app direcotry

mkdir -p app
touch app/requirements.txt
touch app/main.py

[!TIP] You can copy requirements.txt.example file into app directory and rename to app/requirements.txt

[!NOTE] Please make sure that main.py is not empty.

4. Build and start the application using Docker Compose

docker-compose up --build -d

5. Access the FastAPI application

The FastAPI application will be available at http://localhost:8080.

Dockerfile

The Dockerfile sets up the environment for the FastAPI application. It includes the following key steps:

Docker Compose

The docker-compose.yaml file defines the services required for the application. It includes:

Contributing

If you wish to contribute to this project, please follow these steps:

  1. Fork this repository to your own GitHub account.
  2. Clone the forked repository to your local machine.
  3. Create a new branch (git checkout -b feature/your-feature).
  4. Make your changes and commit them (git commit -am 'Add new feature').
  5. Push the changes to your forked repository (git push origin feature/your-feature).
  6. Go to the original repository on GitHub and create a Pull Request from your forked repository.

Contact

For any questions or issues, please contact the project maintainer at nycu1sdc@gmail.com.