Skip to content

fgcz/New_SUSHI_2025

Repository files navigation

New SUSHI 2025

Rails v8 API and FastAPI (backend) + Next.js (frontend) implementation of the SUSHI bioinformatics system.

1. Prerequisites

  • Ruby 3.3.7
  • Python 3.12.x
  • Node.js 22.16.0
  • Git

2. Environment Setup

(on fgcz-r-029)

1. Load Required Modules

module load Dev/Ruby/3.3.7
module load Dev/node/22.16.0

2. Clone Repository

cd /misc/fgcz01/sushi/
git clone git@github.com:fgcz/new_SUSHI_2025
cd new_sushi_2025

3. Backend Setup

cd backend

# Configure Bundler for local gem installation
bundle config set --local path 'vendor/bundle'

# Install gems
bundle install

4. Frontend Setup

cd ../frontend

# Install dependencies
npm install

2. Development Environment Setup (Limited Compilation Environment)

  1. Prepare Libraries on Compilation-Capable Machine:
# Clone repository
git clone git@github.com:fgcz/new_SUSHI_2025
cd new_sushi_2025

# Load required modules
module load Dev/Ruby/3.3.7
module load Dev/node/22.16.0

# Install backend dependencies
cd backend
bundle config set --local path 'vendor/bundle'
cp -r /misc/fgcz01/sushi/new_SUSHI_2025/backend/vendor .

# Run tests to verify setup
bundle exec rspec

# Install frontend dependencies
cd ../frontend
cp -r /misc/fgcz01/sushi/new_SUSHI_2025/frontend/node_modules .

# Run tests to verify setup
npm test
  1. Database Setup (SQLite3, for development):
cd ../backend/
# Setup database
bundle exec rails db:create
bundle exec rails db:migrate

# Run API server
bundle exec rails s -b fgcz-h-083.fgcz-net.unizh.ch -p 4050
  1. Frontend Verification:
cd frontend

# Start development server
npm run dev -- --port 4001

4. Production Deployment Setup

TODO: update

1. Prerequisites

  • Full development environment with compilation tools
  • All system libraries required for native gem compilation
  • Proper SSL certificates and security configurations

2. Backend Production Setup

cd backend

# Configure Bundler for production
bundle config set --local path 'vendor/bundle'

# Install production dependencies
bundle install

# Database setup
RAILS_ENV=production bundle exec rails db:create
RAILS_ENV=production bundle exec rails db:migrate

# Precompile assets (if needed)
RAILS_ENV=production bundle exec rails assets:precompile

# Run production server
RAILS_ENV=production bundle exec rails server -p 4000

3. Frontend Production Setup

cd frontend

# Install production dependencies
npm ci --only=production

# Build application
npm run build

# Start production server
npm start

4. Docker Deployment

# Build images
docker-compose build

# Deploy
docker-compose up -d

# Health check
docker-compose ps

5. Test

1. Backend Tests

cd backend
bundle exec rspec                    # Run all tests
bundle exec rspec --format doc       # Verbose output

2. Frontend Tests

cd frontend
npm test                            # Interactive mode
npm run test:watch                  # Watch mode
npm run test:coverage              # With coverage
npm run test:ci                    # CI mode

6. Project Structure

new_sushi_2025/
├── backend/          # Rails v8 API
│   ├── app/
│   ├── config/
│   ├── spec/         # RSpec tests
│   └── vendor/bundle/ (ignored)
├── frontend/         # Next.js app
│   ├── app/
│   ├── __tests__/
│   └── node_modules/ (ignored)
└── README.md

7. Environment Variables

Create these files if needed (not committed to repository):

1. Backend

# backend/.env
DATABASE_URL=sqlite3:db/development.sqlite3
RAILS_ENV=development

2. Frontend

# frontend/.env.local
NEXT_PUBLIC_API_URL=http://localhost:4000

8. API Documentation

The backend API is documented using Swagger/OpenAPI. Once the backend server is running, you can access the interactive API documentation at:

http://localhost:4050/api-docs/index.html

Or on the deployment server:

http://fgcz-h-083.fgcz-net.unizh.ch:4050/api-docs/index.html

The API documentation provides:

  • List of all available endpoints
  • Request/response schemas
  • Interactive testing interface
  • Authentication requirements

For detailed endpoint documentation, see also:

  • docs/api-datasets-endpoints.md
  • docs/api-project-jobs-endpoint.md
  • docs/api-application-config-endpoint.md
  • docs/api-job-submission-endpoint.md

For implementation details and architecture:

  • docs/job-submission-implementation-plan.md - Job Submission API architecture and implementation plan

9. Architecture

  • Backend: Rails v8 API-only mode, FastAPI (later)
  • Frontend: Next.js 15 with TypeScript
  • Database: SQLite (development), PostgreSQL (production)
  • Testing: RSpec (backend), Jest + React Testing Library (frontend)
  • Styling: Tailwind CSS

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors