Skip to content

sdglitched/FastAPI-lms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAST-API LMS (Learning Management System)

About

Hello Readers!

This is a just learning project for me using boilerplate code from Faraday Academy.

Repo link of this project from Faraday Academy: https://github.com/faraday-academy/fast-api-lms

This project is a learning management system where professors (supervisors) can manage student (users) and students (users) can see their courses.

The project will be similar to the project from Faraday Academy but with more advances from where the Repo is left by Faraday Academy.

Setup

  1. Install git, podman, postgresql, poetry and virtualenv on your development environment.
    Command
    $ sudo dnf install git podman postgresql poetry virtualenv
    
  2. Ensure that podman service is enabled and started.
    Command
    $ sudo systemctl enable podman.service
    
    Sample output
    Created symlink /etc/systemd/system/default.target.wants/podman.service → /usr/lib/systemd/system/podman.service.
    
    Command
    $ sudo systemctl start podman.service
    
  3. Clone the repository to the local storage.
    Command
    $ git clone https://github.com/sdglitched/fast-api-lms.git
    
    Sample output
    Cloning into 'fast-api-lms'...
    remote: Enumerating objects: 79, done.
    remote: Counting objects: 100% (79/79), done.
    remote: Compressing objects: 100% (60/60), done.
    remote: Total 79 (delta 25), reused 61 (delta 15), pack-reused 0
    Receiving objects: 100% (79/79), 41.84 KiB | 209.00 KiB/s, done.
    Resolving deltas: 100% (25/25), done.
    
  4. Download the official postgres image from docker.io/library/quay.io OCI images repository and start a container with your preferred settings.
    Command
    $ podman pull docker.io/library/postgres:latest
    
    Sample output
    Trying to pull docker.io/library/postgres:latest...
    Getting image source signatures
    Copying blob c200c670beef done   | 
    Copying blob 13808c22b207 done   | 
    Copying blob e59e71301578 done   | 
    Copying blob 30258475ebe6 done   | 
    Copying blob dc0c37c3ab3c done   | 
    Copying blob 80df7455ae43 done   | 
    Copying blob d051a616a810 done   | 
    Copying blob 87c27dce0c4d done   | 
    Copying blob 9dae96d37274 done   | 
    Copying blob 9b9e5e72a98e done   | 
    Copying blob 73301da916ba done   | 
    Copying blob 673a1691030a done   | 
    Copying blob 16d03b1cb8d8 done   | 
    Copying blob 9d680d6449b5 done   | 
    Copying config d60dc4bd84 done   | 
    Writing manifest to image destination
    d60dc4bd84c0a07f26f1eb9feefcc94d1dbb3a2d478a0b705aa5e7311353108b
    
    Command (Keep as /home/user/fast-api-lms/db:)
    $ podman run \
        --name <CONTAINER-NAME> \
        --env POSTGRES_USER=<DATABASE-USERNAME> \
        --env POSTGRES_PASSWORD=<DATABASE-PASSWORD> \
        --env POSTGRES_DB=<DATABASE-NAME> \
        --env PGDATA=/var/lib/postgresql/data/pgdata \
        --volume <MOUNT-LOCATION>:/var/lib/postgresql/data:Z \
        --publish 5432:5432 \
        --restart unless-stopped \
        --detach postgres:latest
    
    Command
    $ podman ps -a
    
    Sample output
    CONTAINER ID  IMAGE                              COMMAND     CREATED        STATUS        PORTS                   NAMES
    3f766ea080a9  docker.io/library/postgres:latest  postgres    3 minutes ago  Up 3 minutes  0.0.0.0:5432->5432/tcp  lms_container
    
  5. Create a virtual environment in the said directory and activate it.
    Command
    $ virtualenv venv
    
    Sample output
    created virtual environment CPython3.12.2.final.0-64 in 433ms
      creator CPython3Posix(dest=/home/`user`/fast-api-lms/venv, clear=False, no_vcs_ignore=False, global=False)
      seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, via=copy, app_data_dir=/home/`user`/.local/share/virtualenv)
        added seed packages: pip==23.2.1
      activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
    
    Command
    $ source venv/bin/activate
    
    Sample output
    (venv) $
    
  6. Install the project dependencies.
    Command
    (venv) $ poetry check
    
    Sample output
    All set!
    
    Command
    (venv) $ poetry install
    
    Sample output
    Installing dependencies from lock file
    Package operations: 19 installs, 0 updates, 0 removals
    • Installing idna (3.4)
    • Installing sniffio (1.3.0)
    • Installing typing-extensions (4.8.0)
    • Installing annotated-types (0.6.0)
    • Installing anyio (3.7.1)
    • Installing greenlet (3.0.0)
    • Installing markupsafe (2.1.3)
    • Installing pydantic-core (2.10.1)
    • Installing click (8.1.7)
    • Installing h11 (0.14.0)
    • Installing mako (1.2.4)
    • Installing pydantic (2.4.2)
    • Installing sqlalchemy (2.0.22)
    • Installing starlette (0.27.0)
    • Installing alembic (1.12.1)
    • Installing fastapi (0.103.2)
    • Installing psycopg2-binary (2.9.9)
    • Installing sqlalchemy-utils (0.41.1)
    • Installing uvicorn (0.23.2)
    
  7. Run the development server. Command
    uvicorn main:app --reload
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published