π Index
- About
- Features
- Usage
- File Structure
- Static
- Production mode and deployment
- Contributions
- Gallery
- Credit/Acknowledgment
- License
π° About
This is the main website for JODC built with Svelte and Sapper
π Features
- Completely responsive Web Application.
- Built completely in Svelte+Sapper.
- Open for opensource contributions.
β‘ Usage
- However you get the code, you can install dependencies and run the project in development mode with:
$ cd jiitodc.github.io
$ npm install # or yarn
$ npm run dev
- Open up localhost:3000 and start clicking around.
- Consult sapper.svelte.dev for help getting started.
π File Structure
- Add a file structure here with the basic details about files, below is current file structure.
.
βββ package-lock.json
βββ package.json
βββ README.md
βββ rollup.config.js
βββ src
β βββ client.js
β βββ components
β β βββ EventComponent.svelte
β β βββ Nav.svelte
β β βββ TeamComponent.svelte
β β βββ TeamComponent_Old.svelte
β βββ routes
β β βββ _error.svelte
β β βββ _layout.svelte
β β βββ events.svelte
β β βββ index.svelte
β β βββ team
β β βββ index.svelte
β β βββ team-2018.svelte
β β βββ team-2019.svelte
β βββ server.js
β βββ service-worker.js
β βββ template.html
βββ static
β βββ Data/
β βββ favicon.svg
β βββ global.css
β βββ manifest.json
β βββ Photos/
β βββ posters/
βββ vercel.json
- Sapper expects to find two directories in the root of your project β
src
andstatic
.
No | File Name | Details |
---|---|---|
1. | src | The src directory contains the entry points for your app β client.js , server.js and (optionally) a service-worker.js β along with a template.html file and a routes directory. |
2. | src/routes | This is the heart of your Sapper app. There are two kinds of routes β pages, and server routes. |
3. | Pages | Pages are Svelte components written in .svelte files. When a user first visits the application, they will be served a server-rendered version of the route in question, plus some JavaScript that 'hydrates' the page and initialises a client-side router. From that point forward, navigating to other pages is handled entirely on the client for a fast, app-like feel. (Sapper will preload and cache the code for these subsequent pages, so that navigation is instantaneous.) |
3. | Server Routes | Server routes are modules written in .js files, that export functions corresponding to HTTP methods. Each function receives Express request and response objects as arguments, plus a next function. This is useful for creating a JSON API |
For example:-
There are three simple rules for naming the files that define your routes:
- A file called
src/routes/about.svelte
corresponds to the/about
route. A file calledsrc/routes/blog/[slug].svelte
corresponds to the/blog/:slug
route, in which case params.slug is available to the route - The file src/routes/index.svelte (or src/routes/index.js) corresponds to the root of your app.
src/routes/about/index.svelte
is treated the same assrc/routes/about.svelte
. - Files and directories with a leading underscore do not create routes. This allows you to colocate helper modules and components with the routes that depend on them β for example you could have a file called
src/routes/\_helpers/datetime.js
and it would not create a/\_helpers/datetime route
Static
The static directory contains any static assets that should be available. These are served using sirv
.
In your service-worker.js file, you can import these as files from the generated manifest...
import { files } from '@sapper/service-worker';
...so that you can cache them (though you can choose not to, for example if you do not want to cache very large files).
Production mode and deployment
To start a production version of your app, run npm run build && npm start. This will disable live reloading, and activate the appropriate bundler plugins.
π₯ Contributions
We welcome contributions from everyone. Here are the guidelines if you are thinking of helping us:
Contributions should be made in the form of GitHub pull requests. Each pull request will be reviewed by someone with permission to land patches and either landed in the main tree or given feedback for changes that would be required. All contributions should follow this format.
Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.
Look for good first issues to find good tasks to start with. Your contributions are always welcome and appreciated. Following are the things you can do to contribute to this project.
-
Report a bug
If you think you have encountered a new issue, and we should know about it, feel free to report it and we will take care of it. -
Create a pull request
It cannot get better then this, your pull request will be appreciated by the community. You can get started by picking up any open issues and make a pull request.
If you are new to open-source, make sure to check read more about it here and learn more about creating a pull request here.
π· Gallery
The main landing Page.
The Events Page.