WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

marcogonzalo/marianna-tests

Repository files navigation

Assessment System

A system for creating and managing assessments with different scoring methods.

Prerequisites

  • Docker and Docker Compose
  • Python 3.x (for local development)
  • Node.js 22.x (for local client development)

Project Structure

  • api/: FastAPI backend service
  • client/: React 19 frontend application with Vite

Development Setup

  1. Clone the repository:
git clone <repository-url>
cd <project-directory>
  1. Copy the environment files and configure your variables:
# API environment
cd api
cp .env.example .env.development

# Client environment
cd ../client
cp .env.example .env.development
  1. Start the development environment:
docker-compose up

This will start:

API Documentation

Once the API is running, you can access:

Test Environment

To run the test suite:

# Run all tests
docker-compose -f docker-compose.test.yml up --build --abort-on-container-exit

# Run specific tests
docker-compose -f docker-compose.test.yml run api pytest api/tests/specific_test.py

# Run with coverage report
docker-compose -f docker-compose.test.yml run api pytest --cov=api api/tests/

Production Environment

To deploy the application in production:

  1. Configure production environment variables:
# API production environment
cd api
cp .env.example .env
# Edit .env.prod with your production settings

# Client production environment
cd ../client
cp .env.example .env
# Edit .env.prod with your production settings
  1. Build and start the production services:
docker-compose -f docker-compose.prod.yml up --build -d

This will start:

  1. Create the initial admin user in production (if first deployment):
docker-compose -f docker-compose.prod.yml exec api pipenv run create-admin

Production Health Checks

The production environment includes health checks for all services:

Development Without Docker

API Setup

cd api
pipenv shell
pipenv install
pipenv run create-admin  # Create initial admin user
uvicorn main:app --reload

Client Setup

cd client
npm install
npm run dev

The client will be available at http://localhost:5173

Environment Variables

API Environment Variables:

  • DATABASE_URL: PostgreSQL connection string
  • ENVIRONMENT: Development/production environment
  • DEBUG: Enable/disable debug mode
  • SECRET_KEY: JWT secret key (required in production)
  • CORS_ORIGINS: Allowed CORS origins

Client Environment Variables:

  • VITE_API_URL: API endpoint URL (default: http://api:8000 in Docker)
  • HOST: Host to bind the development server (default: 0.0.0.0)

Check .env.example files in both api/ and client/ directories for all available configuration options.

Common Issues

  1. If you get permission errors with the database volume:
sudo chown -R 1000:1000 postgres_data/
  1. If the client build fails with TypeScript errors in production:
# You can force the build with
docker-compose -f docker-compose.prod.yml build --build-arg TSC_COMPILE_ON_ERROR=true
  1. If you need to reset the database:
# Stop all containers and remove volumes
docker-compose down -v
# Then restart with
docker-compose up --build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published