Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve documentation #19

Closed
akshatagarwl opened this issue Sep 27, 2020 · 10 comments · Fixed by #34
Closed

improve documentation #19

akshatagarwl opened this issue Sep 27, 2020 · 10 comments · Fixed by #34
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest

Comments

@akshatagarwl
Copy link
Member

akshatagarwl commented Sep 27, 2020

Content to be added in README.md most of it is directly taken from the sapper starter template:


Index

Running the project

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.

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 and static.

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.

src/routes

This is the heart of your Sapper app. There are two kinds of routes — pages, and server routes.

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.)

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 called src/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 as src/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 don't 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.

@akshatagarwl akshatagarwl added documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest labels Sep 27, 2020
@ampsteric
Copy link
Contributor

can you please explain in detail what has to be added in README.md file exactly?

@akshatagarwl
Copy link
Member Author

@ampsteric Sure! Most of the content in the issue description can be added directly. But if you want you can add some other details as well if you find something missing. For example here is an example of a project with an excellent README. https://github.com/code-monk08/connect4. You can add some contribution guidelines, a gallery section which contains screenshots of the website, credits/acknowledgement section for the contributors and other stuff like that.

@ampsteric
Copy link
Contributor

okay. I would love to do that. can you please assign it to me?
And can I send the PR on 1st October for the count in Hacktoberfest? or Should I make PR before 1st and you merge it during hacktoberfest?

@akshatagarwl
Copy link
Member Author

Done @ampsteric. AFAIK if you want your PRs to be counted in Hacktoberfest you have to create them after 1st Oct so you can send it after that.

@ampsteric
Copy link
Contributor

@humancalico okay.
I will send a PR after 1st of oct only. Thanks for understanding.

@ampsteric
Copy link
Contributor

okay. will surely do that.

@ampsteric
Copy link
Contributor

@humancalico can you please mention what do you want under the guidelines section?

@akshatagarwl
Copy link
Member Author

akshatagarwl commented Sep 29, 2020

@ampsteric Nothing really, the How to contribute section in the README is fine imo.

@ampsteric
Copy link
Contributor

Okay. Thanks for the clarification.

@ampsteric
Copy link
Contributor

resolved the #19 issue.
Please review it and accept my contribution for JIITODC and HACTOBERFEST.

best regards,
ampsteric

prityusha pushed a commit to prityusha/jiitodc.github.io that referenced this issue Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants