An open-source API repository for public universities.
This API is not affilitated with any universities. The data is collected based on public search engines with public information. Information may be incorrect, unofficial, or outdated. Please use with caution.
The data is a collection of information from universities' public information. If you couldn't find the information you need, or the information is incorrect, please send an email to [email protected] for your request.
.
├── cursus # Core directory
│ ├── app.py # Main Flask application
│ ├── config.py # Configuration file
│ ├── __init__.py
│ ├── apis/ # API endpoints
│ ├── models/ # ORM models for database
│ ├── schema/ # Pydantic schemas-to-json for APIs
│ ├── static/ # Static files
│ ├── templates/ # HTML pages
│ ├── util/ # Utility functions
│ └── views/ # Flask views and blueprints
├── data/ # Initial data for development
├── migrations/ # Alembic migration folder
├── nginx/ # Nginx configuration (development)
├── sql/ # Backup SQL scripts
├── test/ # Test directory
├── docker-compose.yml # Docker compose to orchestrate docker containers
├── Dockerfile # Python Docker image for development
├── Dockerfile.prod # Python Docker image for production
├── manage.py # CLI script
└── pyproject.toml # Core Python configuration- Python (
python>=3.11) - Git (https://git-scm.com/downloads)
- Docker (https://docs.docker.com/desktop)
- Virtualenv (https://docs.python.org/3/library/venv.html)
git clone https://github.com/richardnguyen99/cursus.gitYou need to create an .env file in order to start the application. The .env
will be used by Docker Compose to set up and boot up all the docker containers.
For example,
APP_SETTINGS="cursus.config.DevConfig"
POSTGRES_USER="postgres"
POSTGRES_PASSWORD="something-secret"
POSTGRES_DB="cursus"
PGPORT=7432
DATABASE_URL="postgresql://postgres:[email protected]:7432/cursus"
PGADMIN_DEFAULT_EMAIL="[email protected]"
PGADMIN_DEFAULT_PASSWORD="pgadmin"
PGADMIN_LISTEN_PORT=5050Please check .env.example for more details.
DATABASE_URLmight be different depending on your docker network. You can check the IP Addres for thepostgrescontainer by runningdocker inspect <container_id> | grep IPAddress.
docker-compose up --buildDocker Compose will boot up everything for you. You can access the application with these following URLs:
http://locahost: The main application. NGINX will serve as the reverse proxy for the application. Every request will be redirected to the application.http://localhost:5050: The Flask application.http://admin.localhost: The PGAdmin application.http://localhost:7432: The PostgreSQL database.
First, you need to install alembic to run the migration. I recommend you to
install it in a virtual environment with your choice of package manager. After
activating the virtual environment, run:
python3 manage.py db upgradeThis will run the first migration to create the database schema for you.
This project is licensed under the terms of the MIT license.